import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
export default new Vuex.Store({
  state: {
    map: null,
    docLayer: null,
    showHeatMap: null,
    highLightCamera: false,
  },
  getters: {
    initMap(state) {
      return state.map
    },
  },
  mutations: {
    addMap(state, map) {
      state.map = map
    },
    addLayer(state, docLayer) {
      state.docLayer = docLayer
    },
    Accident(state, value) {
      state.showHeatMap = value
    },
    CAMERA(state, value) {
      state.highLightCamera = value
    },
  },
  actions: {
    camera(ctx, value) {
      ctx.commit('CAMERA', value)
    },
  },
})
